package com.imooc.product.design.sing;

/**
 * Created on 2020/2/3.
 *
 * @author Grak
 * @since 1.0
 */
public class DoubleCheckLazySingleton {
    private volatile static DoubleCheckLazySingleton lazySingleton = null;
    private DoubleCheckLazySingleton(){}

    public static DoubleCheckLazySingleton getInstance(){
        if(lazySingleton == null){
            synchronized (DoubleCheckLazySingleton.class){
                if(lazySingleton == null){
                    lazySingleton = new DoubleCheckLazySingleton();
                }
            }
        }
        return lazySingleton;
    }
}
